package com.kaifamiao.response;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

@WebServlet("/normal/status")
public class NormalStatusServlet extends HttpServlet {

    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        // 获取响应对象的缓冲区容量
        System.out.println( "buffer size: " + response.getBufferSize() );
        // 设置响应对象的缓冲区容量
        response.setBufferSize( 8192 );

        // 获得用于向响应对象的缓冲区中输出数据的字符打印流
        PrintWriter out = response.getWriter();

        out.println( "<h1 style=\"text-align: center; \">" );
        out.println( "Normal Status: " + response.getStatus() );
        out.println( "</h1>" );

    }

}
